<!DOCTYPE html>
<html lang="en">
<head>
    {include file="public/meta" /}
    {include file="public/link" /}
    {include file="public/form" /}
    <style>
        input.check_box {
            width: 100px;
        }

        .p_checkbox {
            width: 25%;
            float: left;
        }
    </style>
</head>
<body data-type="index" class="theme-white">
<div class="am-g tpl-g">
    {include file="public/header" /}
    {include file="public/left" /}
    {include file="public/content_top" /}
    <ol class="am-breadcrumb" style="    margin-bottom: 0;">
        <li><a href="../home/index.html" class="am-icon-home">首页</a></li>
        <li><a href="#">协议管理</a></li>
        <li class="am-active">协议</li>
    </ol>
    <div class="widget am-cf">
        <form class="am-cf" id="form" onsubmit="return false">
            <div class="am-panel am-panel-primary">
                <div class="am-panel-hd">基础信息</div>
                <div class="am-form-group">
                    <span class="s1">协议名称：</span>
                    <label class="am-form-label">
                        <input type="text" id="" class="am-form-field am-input-sm" name="title"
                               value="{$list['title']}"/>
                    </label>
                </div>
                <div class="am-form-group">
                    <span class="s1">协议描述：</span>
                    <label class="am-form-label">
                        <input type="text" class="am-form-field am-input-sm" name="desc" value="{$list['desc']}"/>
                    </label>
                </div>
                <input type="hidden" class="am-form-field am-input-sm" name="id" value="{$list['id']}"/>
                <div class="am-form-group">
                    <span class="s1" style="vertical-align: top">内容：</span>
                    <label class="am-form-label" style="max-width: 60%">
                        <textarea id="content" name="content" style="height:500px;">{$list['content']}</textarea>
                    </label>
                </div>

                <div class="am-panel-bd" style="padding-bottom: 1rem;margin-left: 13rem">
                    <button type="submit" class="am-btn am-btn-primary am-btn-sm" onclick="sub() ">确定</button>
                    <a href="agree.html" class="am-btn am-btn-secondary am-btn-sm">返回</a>
                </div>
            </div>
    </div>
    </form>
</div>
</div>
{include file="public/editor" /}
{include file="public/foot" /}
<script type="text/javascript" src="/static/ajaxupload.js"></script>
<script type="text/javascript">
    $(function () {
        var nav = $('.left-sidebar li.sidebar-nav-link');
        nav.removeClass("active");
        nav.eq(1).find('ul').show();
        nav.eq(1).find('ul li').eq(6).find('a').addClass('active');
    });

    function sub() {
        var arr = parseFormJson("#form");
        $.ajax({
            url: "{:url('Article/agree_add_edit')}",
            data: {arr: arr},
            type: "post",
            success: function (r) {
                // console.log(r);
                // return false;
                if (r['code'] == 1) {
                    alert_open(r['msg'])
                } else {
                    alert_msg(r['msg']);
                }
            }
        });
    }
</script>
</body>
</html>